home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-01-26 | 2.4 KB | 69 lines |
- ' AMOSPRO
- '
- ' ********************************************************
- ' *** ***
- ' *** Wash Bob Procedure ***
- ' *** ***
- ' *** by ***
- ' *** ***
- ' *** Joseph Bolin ***
- ' *** ***
- ' ********************************************************
-
- For Y=0 To 15
- Ink Y : Bar 0,Y*8 To 127,Y*8+7
- Next
- Get Icon 1,0,0 To 128,128
- For C=0 To 15
- _WASHBOB[-1,C,2]
- Paste Icon 160,0,1
- Next
-
- Procedure _WASHBOB[_BOB,_COLOR,_CHANGE]
-
- ' Inputs: _BOB Bob to change the color of --- Negative numbers signify icons
- ' _COLOR Color to change
- ' _CHANGE Color to change it to
- '
- ' Outputs: Washes one color of a bob to another color
-
- If _BOB>=0 Then SBASE=Sprite Base(_BOB) Else SBASE=Icon Base(-_BOB)
- _TEMP=Length(1)+1
- If SBASE=0 and _BOB>0 Then Error 68
- If SBASE=0 and _BOB<0 Then Error 74
- XSZ=Deek(SBASE)*16 : YSZ=Deek(SBASE+2) : NPLANES=Deek(SBASE+4)
- FLAG=1
- SCR=Screen
- NC=1
- Rol.w NPLANES,NC
- For SC=0 To 7
- Trap Screen SC : If Errtrap<>0 : Screen Open SC,XSZ,YSZ*2,NC,Lowres : Screen Hide : Exit : End If
- Next
- If SC=8 : Error 47 : End If : Rem *** no available screens!! ***
- ST=SBASE+10 : SZ=XSZ/8*YSZ
- Cls 1 : Get Bob _TEMP,0,0 To XSZ,YSZ : SBASE2=Sprite Base(_TEMP)
- AD=SBASE+10 : No Mask _TEMP : CL=1
- For PL=0 To NPLANES-1
- Copy AD,AD+SZ To SBASE2+10 : Paste Bob 0,0,_TEMP
- If CL and _COLOR Then Screen Copy SC,0,0,XSZ,YSZ To SC,0,YSZ,%10000000
- If(CL and _COLOR)=0 Then Screen Copy SC,0,0,XSZ,YSZ To SC,0,YSZ,%100000
- CL=CL*2 : Add AD,SZ
- Next
- Get Bob _TEMP,0,YSZ To XSZ,YSZ*2
- SBASE2=Sprite Base(_TEMP)+10 : AD=SBASE2+SZ
- If NPLANES=1 Then Goto SKIP
- CL=2
- For PL=1 To NPLANES-1
- If CL and _CHANGE Then Copy SBASE2,SBASE2+SZ To AD
- If(CL and _CHANGE)=0 Then Fill AD To AD+SZ,0
- Add AD,SZ : CL=CL*2
- Next
- If(_CHANGE and 1)=0 Then Fill SBASE2 To SBASE2+SZ,0
- SKIP:
- Cls 0 : If _BOB>0 Then Paste Bob 0,0,_BOB Else Paste Icon 0,0,-_BOB
- Paste Bob 0,0,_TEMP
- If _BOB>0 Then Get Bob _BOB,0,0 To XSZ,YSZ Else Get Icon -_BOB,0,0 To XSZ,YSZ
- Screen Close Screen
- Screen SCR
- Del Bob _TEMP
- End Proc